package com.godfrey.service;

import com.godfrey.entity.Order;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * @author godfrey
 * @since 2020-12-27
 */
@Service
@RocketMQMessageListener(consumerGroup = "myConsumer", topic = "myTopic")
public class SmsService implements RocketMQListener<Order> {

    private static final Logger log = LoggerFactory.getLogger(SmsService.class);

    @Override
    public void onMessage(Order order) {
        log.info("新订单{},发短信通知用户", order);
    }
}